from appium.webdriver.common.mobileby import MobileBy
from appium.webdriver.webdriver import WebDriver


from test_appium.test_wechat.PO.PO_page.AddressListPage import AddressListPage
from test_appium.test_wechat.PO.PO_page.BasePage import BasePage
from test_appium.test_wechat.PO.PO_page.My_Page import My_Page




class MainPage(BasePage):
    connect_btn = (MobileBy.XPATH,"//*[@resource-id='com.tencent.wework:id/ewt'and @text='通讯录']")

    def click_contact(self):
        """
        点击通讯录
        goto通讯录
        :return:
        """

        self.find_and_click(*self.connect_btn)

        return AddressListPage(self.driver)

    def click_my(self):
        """

        :return:
        """
        return My_Page()

